﻿using System.Data.Entity;
using NTQOnlineExam.Services.EntityFW.Entity;

namespace NTQOnlineExam.Services.EntityFW.Context
{
    public partial class ExamOnlineDbContext : DbContext
    {
        public ExamOnlineDbContext()
            : base("name=DefaultConnection")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new TermMap());
            modelBuilder.Configurations.Add(new UserProfileMap());
            modelBuilder.Configurations.Add(new SectionMap());

            modelBuilder.Configurations.Add(new OrderMap());
            modelBuilder.Configurations.Add(new OrderDetailMap());

            modelBuilder.Configurations.Add(new BasketMap());
            modelBuilder.Configurations.Add(new BasketItemMap());
            modelBuilder.Configurations.Add(new PortfolioMap());
            modelBuilder.Configurations.Add(new YearMap());
        }

        public DbSet<Term> Terms { get; set; }
        public DbSet<UserProfile> UserProfiles { get; set; }
        public DbSet<Section> Sections { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderDetail> OrderDetails { get; set; }
        public DbSet<Basket> Baskets { get; set; }
        public DbSet<BasketItem> BasketItems { get; set; }
        public DbSet<Portfolio> Portfolios { get; set; }
        public DbSet<Year> Years{ get; set; }
    }


}

